#include"udp_server.hpp"
#include"Dict.hpp"
#include<memory>
#include<functional>
int main(int argc,char* argv[])
{
    if(argc!=2)
    {
        std::cerr << "Usage: " << argv[0] << " local-port" << std::endl;
        exit(-1);
    }
    uint16_t port=stoi(argv[1]);
    Dict dict("./Dict.txt");
    auto func=std::bind(&Dict::Translate,&dict,std::placeholders::_1);
    unique_ptr<UDPServer> usvr=make_unique<UDPServer>(func,port);
    usvr->Init();
    usvr->Start();
    return 0;
}